<template>
  <div>
    <h1>使用过滤器处理{{timeStamp}}时间戳</h1>
    <p>时间1:{{ timeStamp | filter('-') }}</p>
    <p>时间2:{{ timeStamp | filter('/')}}</p>
  </div>
</template>

<script>
import moment from 'moment'
export default {
  data () {
    return {
      timeStamp: 1636450540055
    }
  },
  filters: {
    filter (val, splitter) {
      return moment(val).format(`YYYY ${splitter} MM ${splitter} DD`)
    }
  },
  created () {

  },

  methods: {

  }
}
</script>

<style scoped lang='less'>

</style>
